<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="taglibs.jsp"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Wiki Events - Search results </title>
        
        <!-- jQuery -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <!-- BEGIN TimelineJS -->
        <script type="text/javascript" src="http://cdn.knightlab.com/libs/timeline/latest/js/storyjs-embed.js"></script>
        
		<script>
		var dataObject=${actionBean.jsonForTimeline};
		var currentEventIndex = ${actionBean.currentEventIndex};
		//alert (currentEventIndex);
		$(document).ready(function() {
		    createStoryJS({
		        type:       'timeline',
		        width:      '95%',
		        height:     '600',
		        source:     dataObject,
		        embed_id:   'my-timeline',
		        start_at_slide: currentEventIndex
		    });
		});
		</script>
		
		
</head>
<body">
	<%@include file="searchForm.jsp"%>
	<table>
		<tr>
			<td>
					Query path:
					<s:link beanclass="l3s.wikirevisions.WikiActionBean">
						<s:param name="query" value="${actionBean.query}" />
						<s:param name="fromDate" value="${actionBean.fromDate}" />
						<s:param name="toDate" value="${actionBean.toDate}" />
						 ${actionBean.query}
					</s:link>					
			</td>
					<c:set var="appliedFilters" value="" />
					
					<c:forEach var="count" items="${actionBean.appliedFiltersList}">
							<c:set var="appliedFilters" value="${appliedFilters}###${count }" />
							<td>
							&nbsp;>&nbsp;
							<s:link beanclass="l3s.wikirevisions.WikiActionBean" class="myLink">
								<s:param name="query" value="${actionBean.query}" />
								<s:param name="addedFilter" value="${appliedFilters}" />							
								<s:param name="fromDate" value="${actionBean.fromDate}" />
								<s:param name="toDate" value="${actionBean.toDate}" />
									${count}										
									
							</s:link>
							</td>
						<br />
					</c:forEach>	
			
		</tr>
	
	</table>
	<table width="100%">
		<tr>
			<td width="20%">
				<%@include file="filters.jsp"%>
			</td>				
			<td width="80%">
				<div class="myCustomBox">					
					<div id="my-timeline" ></div>
				</div>
				<div>
					Pages:
					<c:forEach var="pageID" begin="${actionBean.pageEventMin }" end="${actionBean.pageEventMax }">
						<s:link beanclass="l3s.wikirevisions.WikiActionBean">
							<s:param name="query" value="${actionBean.query}" />
							<s:param name="pageEvent" value="${pageID}" />
							<s:param name="fromDate" value="${actionBean.fromDate}" />
							<s:param name="toDate" value="${actionBean.toDate}" />
							<c:choose>
								<c:when test="${pageID == actionBean.pageEvent }">
									<b>[${pageID }]</b>
								</c:when>
								<c:otherwise>
									${pageID }
								</c:otherwise>
							</c:choose>
						</s:link>
					
					</c:forEach>				
				</div>
			</td>
	</table>	
</body>
</html>